package QHgui.docing;

import QHgui.MainWorkingPanel;
import SingleService.SingleInstance;
import SingleService.SingleInstanceKey;
import com.javadocking.dockable.Dockable;
import com.javadocking.dockable.DockableState;
import com.javadocking.dockable.action.DockableStateAction;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * <p> TODU </P>
 *
 * @author yeager
 * @Version V1.1.1.0
 * @date 2023/11/24 10:30
 */
public class SCloseOtherDockableStateAction extends AbstractAction implements DockableStateAction {
    private Dockable dockable;
    public SCloseOtherDockableStateAction(Dockable dockable,Icon icon)
    {
        super("Close Others",icon);
        this.dockable=dockable;
    }
    @Override
    public void actionPerformed(ActionEvent arg0) {
        MainWorkingPanel mwp=(MainWorkingPanel) SingleInstance.getInstance(SingleInstanceKey.MainWorkingPanel);
        //mwp.closeAllOtherDrawing(dockable);
    }

    @Override
    public Dockable getDockable() {
        return dockable;
    }

    @Override
    public int getNewDockableState() {
        return DockableState.CLOSED;
    }
}
